package com.bobo.serviceorder.service.impl;

import com.bobo.serviceorder.service.GrabService;
import com.bobo.serviceorder.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author bobo
 * @date 2021-04-13
 */
@Service
public class GrabNoLockServiceImpl implements GrabService {

    @Autowired
    private OrderService orderService;

    @Override
    public String grabOrder(int orderId, int driverId) {
        boolean b = orderService.grabOrder(orderId, driverId);
        if (b) {
            System.out.println("抢单成功");
        } else {
            System.out.println("抢单失败");
        }
        return b ? "抢单成功" : "抢单失败";
    }
}
